{% load engine_tags %}

<form method="post" class="ui form" action="#"
      enctype='multipart/form-data'>

    <div class="ui title header">Edit Recipe</div>

    <div class="two fields">
        <div class="field">
            <label>Name</label>
            {{ form.name }}
            <div class="muted">Recipe display name</div>
        </div>
        <div class="field">
            <label>Identifier</label>
            {{ form.uid }}
            <div class="muted">Unique identifier for the recipe.</div>
        </div>

        {% if user.is_superuser %}
            <div class="field">
                <label>Authorization</label>
                {{ form.security }}
                <p class="muted"> Determines who can run a recipe.</p>
            </div>
        {% endif %}

    </div>

    <div class="two fields">
        <div class="field">
            <span><b>Image</b> : </span>
            {{ form.image.errors }}
            {{ form.image }}
            <div class="muted">Optional image for the recipe ( 500px Maximum ).</div>
        </div>
        <div class="field">
            <span><b>Rank</b>: </span>
            {{ form.rank }}
            <div class="muted">Used to order recipes (optional).</div>
        </div>
    </div>

    <div class="field">

        {{ form.text }}

    </div>

    <div class="item">
        <button class="ui green  {{ btn_state }} button ajax" type="submit">
            <i class="save icon"></i> Save
        </button>

        <a class="ui right floated gray button click" data-value="#info">
            <i class="arrow left icon"></i> Back
        </a>
    </div>

</form>
